<script setup>
import { ref } from 'vue';
import chartApi from "@/api/chart.js";

const userCount = ref(0);
const coachCount = ref(0);
const courseCount = ref(0);
const reserveCount = ref(0);

chartApi.selectUserTotal().then(result=>{
  userCount.value = result.data;
});
chartApi.selectCoachTotal().then(result=>{
  coachCount.value = result.data;
});
chartApi.selectCourseTotal().then(result=>{
  courseCount.value = result.data;
});
chartApi.selectReserveTotal().then(result=>{
  reserveCount.value = result.data;
});

</script>

<template>
  <el-row>
    <el-col :span="6">
      <div class="title">会员数量</div>
      <div class="count mem">{{ userCount }}</div>
    </el-col>
    <el-col :span="6">
      <div class="title">教练数量</div>
      <div class="count coa">{{ coachCount }}</div>
    </el-col>
    <el-col :span="6">
      <div class="title">课程数量</div>
      <div class="count cou">{{ courseCount }}</div>
    </el-col>
    <el-col :span="6">
      <div class="title">预约数量</div>
      <div class="count res">{{ reserveCount }}</div>
    </el-col>
  </el-row>
</template>

<style scoped>
.title {
  text-align: center;
  height: 40px;
  line-height: 40px;
}
.count{
  margin: auto;
  width: 75px;
  height: 75px;
  border: 15px solid #49BCF7;
  border-radius: 50px;
  text-align: center;
  line-height: 70px;
  font-size: 30px;
}
.mem{
  border-color: #49BCF7;
  color: #49BCF7;
}
.coa{
  border-color: #91CC75;
  color: #91CC75;
}
.cou{
  border-color: #FAC858;
  color: #FAC858;
}
.res{
  border-color: #5470C6;
  color: #5470C6;
}
</style>